package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;

public class CollectionDemo4 {
    public static void main(String[] args) {
        Collection c1 = new ArrayList();
        //Collection c1 = new HashSet();
        c1.add("温柔人品");
        c1.add("案件多发");
        c1.add("萨克附件");
        System.out.println("c1:"+c1);

        Collection c2 = new ArrayList<>();
        c2.add("阿文等会");
        c2.add("撒旦艰苦");
        c2.add("案件多发");
        System.out.println("c2:"+c2);

        c1.addAll(c2);
        System.out.println("c1:"+c1);
        System.out.println("c2:"+c2);

        Collection c3 = new ArrayList();
        c3.add("温柔人品");
        c3.add("案件多发");
        c3.add("服务其后");
        System.out.println("c3:"+c3);

        boolean contains = c1.containsAll(c3);
        System.out.println("包含所有:"+contains);


        System.out.println("c1:"+c1);
        System.out.println("c3:"+c3);
        //c1.retainAll(c3);

        c1.removeAll(c3);
        System.out.println("c1:"+c1);
        System.out.println("c3:"+c3);
    }
}
